/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pos.domain;

import java.util.Date;
import java.util.Set;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author suraj
 */
@MappedSuperclass
public abstract class ItemTransaction {

    @Temporal(TemporalType.DATE)
    protected Date transactionDate;
    @Enumerated(EnumType.STRING)
    protected Type type;

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public Date getTransactionDate() {
        return transactionDate;
    }

    public void setTransactionDate(Date transactionDate) {
        this.transactionDate = transactionDate;
    }

    public abstract Set getLineItems();

    public abstract void addItem(LineItem item);

    public enum Type {
        Cash,
        Credit
    }
}

